<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width:300px;
            height: 300px;
            background: #000;

            /* 希望经过3秒  背景颜色  从   #000 --- #fff */
            animation: myan 3s   forwards;
        }

        @keyframes myan {
            from{
                background: #000;
            }

            to{
                background: #fff;
            }
        }



    </style>
</head>
<body>


    <div>

    </div>
    
</body>
</html>